﻿
@{
    Layout = null;
}

@*<div>片区管理</div>*@
<script src="~/Scripts/MGJJS/Manager/AreaManage.js"></script>
<div class="mtlr15">
    <div class="row">
        <div class="col-lg-8 col-md-8 col-sm-8" style="padding:0">
            <button type="button" class="btn btn-success" onclick="$.MGJ.AreaManage.AddAreaManager()">
                <i class="glyphicon glyphicon-plus-sign"></i>
                新建
            </button>
            <button type="button" class="btn btn-success" onclick="$.MGJ.AreaManage.ExprotArea('#SaleAreaData')">
                <i class="glyphicon glyphicon-arrow-down"></i>
                导出excel
            </button>
        </div>
        <div class="col-lg-4 col-md-4 col-sm-4">
            <div class="input-group">
                <input type="text" id="SearchKey" class="form-control" placeholder="片区名称" onkeydown="if (event.keyCode == 13) { $.MGJ.AreaManage.GetAreaManageList(1); }">
                <span class="input-group-addon" onclick="$.MGJ.AreaManage.GetAreaManageList(1);">
                    <span class="glyphicon glyphicon-search"></span>
                </span>
            </div>
        </div>
    </div>

    <div id="Table">
        <div class="overflow">
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th width="30px"><input class="AllClickCheckbox" type="checkbox"></th>
                        <th>所属机构</th>
                        <th>片区名称</th>
                        <th>负责人</th>
                        <th>联系电话</th>
                        <th>备注</th>
                        <th>操作时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="SaleAreaData" style="display:none;" binding="{'pageId':'SaleAreaPager','pageCallback':'$.MGJ.AreaManage.GetAreaManageList','emptyHtml':User_EmptyHtml}">
                    <tr>
                        <td width="15"><input type="checkbox" class="AllClickChild" binding="{'ID':'ID'}"></td>
                        <td binding="{'text':'EnterpriseName'}"> </td>
                        <td binding="{'text':'Name'}"></td>
                        <td binding="{'text':'Contacts'}"></td>
                        <td binding="{'text':'ContactTel'}"></td>
                        <td binding="{'text':'Remark'}"></td>
                        <td binding="{'text':'CreateDate','textHandle':'datetime_Date'}"></td>
                        <td>
                            <a binding="{'Id':'ID'}" href="#" onclick="$.MGJ.AreaManage.EditAreaManager(this)">编辑</a>
                            <a href="#" binding="{'Id':'ID'}" onclick="$.MGJ.AreaManage.DelteAreaManager(this)">删除</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div id="SaleAreaPager"></div>
    </div>
    
</div>

<script>
    var ColspanNub = $(".table.table-hover.table-bordered").find("tr").children("td").length
    window.User_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';
    $(function () {
        $.MGJ.AreaManage.GetAreaManageList();
    });
</script>